package com.yuan.web;

import com.yuan.pojo.User;
import com.yuan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService userService;
    @GetMapping("/{username}")
    public User findById(@PathVariable("username") String username){
        User byId = userService.findById(username);
        return byId;
    }
}
